package com.ruoyi.goods.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.goods.mapper.WGoodsInfoMapper;
import com.ruoyi.goods.domain.WGoodsInfo;
import com.ruoyi.goods.service.IWGoodsInfoService;

/**
 * 货物建材Service业务层处理
 * 
 * @author wzy
 * @date 2024-08-30 16:21:42
 */
@Service
public class WGoodsInfoServiceImpl implements IWGoodsInfoService 
{
    @Autowired
    private WGoodsInfoMapper wGoodsInfoMapper;

    /**
     * 查询货物建材
     * 
     * @param goodsId 货物建材主键
     * @return 货物建材
     */
    @Override
    public WGoodsInfo selectWGoodsInfoByGoodsId(Long goodsId)
    {
        return wGoodsInfoMapper.selectWGoodsInfoByGoodsId(goodsId);
    }

    /**
     * 查询货物建材列表
     * 
     * @param wGoodsInfo 货物建材
     * @return 货物建材
     */
    @Override
    public List<WGoodsInfo> selectWGoodsInfoList(WGoodsInfo wGoodsInfo)
    {
        return wGoodsInfoMapper.selectWGoodsInfoList(wGoodsInfo);
    }

    /**
     * 新增货物建材
     * 
     * @param wGoodsInfo 货物建材
     * @return 结果
     */
    @Override
    public int insertWGoodsInfo(WGoodsInfo wGoodsInfo)
    {
        wGoodsInfo.setCreateTime(DateUtils.getNowDate());
        return wGoodsInfoMapper.insertWGoodsInfo(wGoodsInfo);
    }

    /**
     * 修改货物建材
     * 
     * @param wGoodsInfo 货物建材
     * @return 结果
     */
    @Override
    public int updateWGoodsInfo(WGoodsInfo wGoodsInfo)
    {
        wGoodsInfo.setUpdateTime(DateUtils.getNowDate());
        return wGoodsInfoMapper.updateWGoodsInfo(wGoodsInfo);
    }

    /**
     * 批量删除货物建材
     * 
     * @param goodsIds 需要删除的货物建材主键
     * @return 结果
     */
    @Override
    public int deleteWGoodsInfoByGoodsIds(Long[] goodsIds)
    {
        return wGoodsInfoMapper.deleteWGoodsInfoByGoodsIds(goodsIds);
    }

    /**
     * 删除货物建材信息
     * 
     * @param goodsId 货物建材主键
     * @return 结果
     */
    @Override
    public int deleteWGoodsInfoByGoodsId(Long goodsId)
    {
        return wGoodsInfoMapper.deleteWGoodsInfoByGoodsId(goodsId);
    }
}
